package com.tanhua.model.vo;

import com.tanhua.model.domain.SoulTestQuestion;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

/**
 * @Description：test
 * @Create by： 张会豪
 * @Date：2021/11/8 0:01
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SoulTestQuestionVo implements Serializable {

    String id;//String类型
    private String question;//题目内容
    private List<SoulOptionsContentVo> options = Collections.emptyList();

    public static SoulTestQuestionVo init(SoulTestQuestion soulTestQuestion) {
        SoulTestQuestionVo vo = new SoulTestQuestionVo();
        //copy用户属性
        BeanUtils.copyProperties(soulTestQuestion,vo);
        //设置id属性值
        vo.setId(soulTestQuestion.getId().toString());
        return vo;
    }
}
